<?php
namespace app\before\validate;

use think\Validate;

class RedPacketGet extends Validate
{
    protected $rule = [
        'foreign_key' => 'require|number',
        'get_user_id' => 'require|number',
        'price' => 'require|number',
        'add_time' => 'require|number',
    ];
    protected $message = [
        'foreign_key.require' => '红包id为必填项',
        'foreign_key.number' => '红包id需为数字',
        'get_user_id.require' => '领取红包会员ID为必填项',
        'get_user_id.number' => '领取红包会员ID需为数字',
        'price.require' => '领取金额为必填项',
        'price.number' => '领取金额需为数字',
        'add_time.require' => '领取时间为必填项',
        'add_time.number' => '领取时间需为数字',
    ];
    protected $scene = [
        'edit' => [
            'foreign_key',
            'get_user_id',
            'price',
            'add_time',
        ],
    ];
}
